﻿Imports System.Data.SqlClient

Public Class Conexion
    'PIPE
    'Public Shared cadenaConexion = "Data Source=.;Initial Catalog=CAFAPRO;Integrated Security=True"
    'ELECTRO INGENIERÍA
    'Public Shared cadenaConexion As String = "Data Source=CAPACIT-GEN18\SQLEXPRESS;Initial Catalog=CAFAPRO;Integrated Security=True"
    'GALLO
    'Public Shared cadenaConexion As String = "Data Source=.;Initial Catalog=CAFAPRO;Integrated Security=True"
    'Franco
    'cadenaConexion = "Data Source=.;Initial Catalog=CAFAPRO;Integrated Security=True"
    Public Shared cadenaConexion As String = "Data Source=NOTEBOOK-FRAN;Initial Catalog=CAFAPRO;Integrated Security=True"
    'cadenaConexion = "Data Source=.;Initial Catalog=CAFAPRO;Integrated Security=True"
    'CARO
    'cadenaConexion = "Data Source=ABRIL\SQLEXPRESS;Initial Catalog=CAFAPRO;Integrated Security=True"
    'Public Shared cadenaConexion As String = "Data Source=.;Initial Catalog=CAFAPRO;Integrated Security=True"


    'TODO Conectar - Desconectar
    Public Shared Function Conectar() As SqlClient.SqlConnection

        Dim cn As SqlConnection = New SqlConnection(cadenaConexion)
        cn.Open()
        Return cn
    End Function

    Public Shared Sub Desconectar(ByRef cn As SqlClient.SqlConnection)
        cn.Close()
    End Sub
End Class
